Skip to content

Conversation

@subbarayudu8660
Copy link

No description provided.

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 5.27%. Comparing base (50dc68e) to head (590cac2).

Files with missing lines Patch % Lines
src/graph_api.jl 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           master     #26      +/-   ##
=========================================
- Coverage    6.47%   5.27%   -1.20%     
=========================================
  Files           8       8              
  Lines        4342    4323      -19     
=========================================
- Hits          281     228      -53     
- Misses       4061    4095      +34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty impressive for jumping into it without having had prior exposure to any of these tools, good job! I think there is a much more efficient way to set it up though, check out the link I shared. And we need to add tests.

function Graphs.edges(g::IGraph)
edge_list = Vector{Graphs.edgetype(g)}()
adjlist = IGAdjList()
LibIGraph.adjlist_init(g,adjlist,LibIGraph.IGRAPH_ALL,LibIGraph.IGRAPH_LOOPS_TWICE,LibIGraph.IGRAPH_MULTIPLE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find! This seems like a pretty expensive allocating operation. I would expect there to be a way to iterate over edges without having to create the adjlist.

I suspect this will be a better way: https://igraph.org/c/html/latest/igraph-Iterators.html#edge-iterators

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and we also need correctness tests

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by correctness tests?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new feature usually comes with additions to the test suite, so that one can attest that the feature is correctly implemented. More importantly, such tests will be executed for any change in the future, ensuring that the feature is not accidentally broken.

For instance, here you are implementing an edges function. A convenient correctness test would be some self-consistency check. E.g. create a graph by specifically adding some random set of edges. Then call the edges function on that graph and verify that it returns the same set as the initial set you started with. This type of "round trip" consistency checks are a powerful way to detect issues.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commenting on the edge iterators: you will probably also need this to convert edge id to pair of vertex ids https://igraph.org/c/html/latest/igraph-Basic.html#igraph_edge

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

igraph_edge — Returns the head and tail vertices of an edge.
igraph_error_t igraph_edge(
const igraph_t *graph, igraph_int_t eid,
igraph_int_t *from, igraph_int_t *to
); for using this function, I have to pass in some pointer for from and to as I will be using a raw binding so how do i make a pointer in julia?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a idiom in the C language. A C function can not return sophisticated objects like tuples, so instead you give the C function pointers to the locations of each object that you want to "return". So in C even outputs need to be provided as arguments to a function.

In the Julia wrapper for this library, some of these are made a bit nicer. Check the description in the library. There should be a julia function LibIGraph.igraph_edge that is a barebones wrapper of the C function and requires these pointer arguments, but there should also be an autogenerated nice function LibIGraph.edge that directly returns what would have been written in those pointers (and thus does not require pointer arguments). At least that should be the case if the automatic wrapper worked out for this function.

@Krastanov
Copy link
Member

the failing tests, as you guessed in your email, are unrelated to your work -- these are just tests that have not been properly set yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants